# iRODS local rules for ARCS sites
# Default-resource must be set appropriately for your site 
#
#####acSetRescSchemeForCreate|$userNameClient == guest %% $userNameClient == anonymous|msiSetNoDirectRescInp(ARCS-FABRIC%arcs-df.ivec.org%arcs-df.vpac.org%arcs-df.qcif.edu.au%arcs-df.intersect.org.au%arcs-df.tpac.org.au%emii.resource.tpac.org.au%arcs-df.eresearchsa.edu.au)|nop

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/home/*/Archive_S3/*"|msiSetDefaultResc(s3Resc_us,preferred)|nop
acSetRescSchemeForCreate {
	on($objPath like "/ARCS/home/*/Archive_S3/*") {
		msiSetDefaultResc("s3Resc_us","preferred");
		}
	}

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/projects/TCMIP/*"|msiSetDefaultResc(arcs-df.vpac.org,preferred)|nop
#acSetRescSchemeForCreate {
#        on($objPath like "/ARCS/projects/TCMIP/*") {
#                msiSetDefaultResc("arcs-df.vpac.org","preferred");
#                }
#        }

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/home/charlie.bond/*"|msiSetDefaultResc(arcs-df.ivec.org,preferred)|nop
acSetRescSchemeForCreate {
        on($objPath like "/ARCS/home/charlie.bond/*") {
                msiSetDefaultResc("arcs-df.ivec.org","preferred");
                }
        }

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/home/stephen.anthony/*"|msiSetDefaultResc(arcs-df.ivec.org,preferred)|nop
acSetRescSchemeForCreate {
        on($objPath like "/ARCS/home/stephen.anthony/*") {
                msiSetDefaultResc("arcs-df.ivec.org","preferred");
                }
        }

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/home/kylie.pitt/*"|msiSetDefaultResc(arcs-df.qcif.edu.au,preferred)|nop
acSetRescSchemeForCreate {
        on($objPath like "/ARCS/home/kylie.pitt/*") {
                msiSetDefaultResc("arcs-df.qcif.edu.au","preferred");                }
        }

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/projects/PUBLUMW/*"|msiSetDefaultResc(arcs-df.vpac.org,preferred)|nop
#acSetRescSchemeForCreate {
#        on($objPath like "/ARCS/projects/PUBLUMW/*") {
#                msiSetDefaultResc("arcs-df.vpac.org","preferred");
#                }
#        }

#acSetRescSchemeForCreate|"$objPath" like "/ARCS/projects/LiDAR/*"|msiSetDefaultResc(arcs-df.qcif.edu.au,preferred)|nop
acSetRescSchemeForCreate {
        on($objPath like "/ARCS/projects/LiDAR/*") {
                msiSetDefaultResc("arcs-df.qcif.edu.au","preferred");                }
        }

#acSetRescSchemeForCreate||msiSetDefaultResc(ARCS-FABRIC,preferred)|nop
acSetRescSchemeForCreate {
		msiSetDefaultResc("ARCS-FABRIC","preferred");
	}


#acSetVaultPathPolicy||msiSetGraftPathScheme(no,0)|nop
acSetVaultPathPolicy {
		msiSetGraftPathScheme("no","0");
	}

#Replication Rules
#acPostProcForPut|$dataSize > 0|delayExec(<PLUSET>30s</PLUSET>,msiExecCmd(replicate.py,$dataId,null,null,null,*REPLI_OUT),nop)|nop
#acPostProcForCopy|$dataSize > 0|delayExec(<PLUSET>30s</PLUSET>,msiExecCmd(replicate.py,$dataId,null,null,null,*REPLI_OUT),nop)|nop

acSetRescSchemeForRepl {msiSetDefaultResc("ARCS-REPLISET","random"); }

acPostProcForPut
    {
    on($dataSize > 0)
        {
        delay("<PLUSET>30s</PLUSET>")
            {
            msiSysReplDataObj("ARCS-REPLISET","null");
            }
        }
    }

# CURRENT - causing problems (segfault?) with trash related copying?
#acPostProcForCopy
#    {
#    on($dataSize > 0)
#        {
#        delay("<PLUSET>30s</PLUSET>")
#            {
#            msiSysReplDataObj("ARCS-REPLISET","null");
#            }
#        }
#    }


#Access control, trash and quotas
#acAclPolicy|"$userNameClient" != "QuickShare"|msiAclPolicy(STRICT)|nop
acAclPolicy {
        on("$userNameClient" != "QuickShare") {
                msiAclPolicy("STRICT");
                }
        }

#acTrashPolicy||nop|nop
#acRescQuotaPolicy||msiSetRescQuotaPolicy(off)|nop
#acSetReServerNumProc||msiSetReServerNumProc(8)|nop
acTrashPolicy { }
acRescQuotaPolicy {msiSetRescQuotaPolicy("off");}
# NB - some (older) irods docs seem to indicate below number should be in the range 1-4
# NB - the comments in core.re also say: a number in the range 1-4
acSetReServerNumProc {msiSetReServerNumProc("4");}


# Rules to stop deletion and moving. Note that for this to work the corresponding rules most be commented in core.irb
#acPreprocForRmColl|($collParentName != /ARCS/home) && ($collParentName != /ARCS/projects) && ("$collName" != "/ARCS/home/$userNameClient/Archive_S3")|nop|nop
acPreprocForRmColl 
    {
    on(($collParentName != "/ARCS/home") && ($collParentName != "/ARCS/projects") && ($collName != "/ARCS/home/$userNameClient/Archive_S3"))
        {
        }
    }

#acPreProcForObjRename(*sourceObject,*destObject)|("*sourceObject" like "/ARCS/home/*/*") && ("*sourceObject" != "/ARCS/home/$userNameClient/Archive_S3")|nop|nop
acPreProcForObjRename(*sourceObject,*destObject)
    {
    on(("*sourceObject" like "/ARCS/home/*/*") && ("*sourceObject" != "/ARCS/home/$userNameClient/Archive_S3"))
        {
        }
    }

#acPreProcForObjRename(*sourceObject,*destObject)|"*sourceObject" like "/ARCS/projects/*/*"|nop|nop
acPreProcForObjRename(*sourceObject,*destObject) {
                on("*sourceObject" like "/ARCS/projects/*/*") {
                }
        }

#acPreProcForObjRename(*sourceObject,*destObject)|"*sourceObject" like "/ARCS/trash/*"|nop|nop
acPreProcForObjRename(*sourceObject,*destObject) {
                on("*sourceObject" like "/ARCS/trash/*") {
                }
        }

